package com.zhenhao.xsq.ui.activity.user.module;


import com.zhenhao.xsq.data.api.HttpAPIWrapper;
import com.zhenhao.xsq.ui.activity.base.ActivityScope;
import com.zhenhao.xsq.ui.activity.user.UserInfoActivity;
import com.zhenhao.xsq.ui.activity.user.contract.UserInfoContract;
import com.zhenhao.xsq.ui.activity.user.presenter.UserInfoPresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author xlei
 * @Package com.yxld.gb.xsq.ui.activity.user
 * @Description: The moduele of UserInfoActivity, provide field for UserInfoActivity
 * @date 2019/03/15 13:59:39
 */
@Module
public class UserInfoModule {
    private final UserInfoContract.View mView;


    public UserInfoModule(UserInfoContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public UserInfoPresenter provideUserInfoPresenter(HttpAPIWrapper httpAPIWrapper, UserInfoActivity mActivity) {
        return new UserInfoPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public UserInfoActivity provideUserInfoActivity() {
        return (UserInfoActivity) mView;
    }
}